﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HKEA.CMS.Core.Utility;
using HKEA.CMS.Core.Models;
using HKEA.CMS.Core.BLL.Tbl;

namespace WebApplication.UserControl
{
    public partial class M_MainTabControl : System.Web.UI.UserControl
    {
        protected string url_param = string.Empty;
        BasePage basepage = new BasePage();
        protected void Page_Load(object sender, EventArgs e)
        {
            InitUrlParam();
        }

        private void InitUrlParam()
        {
            string uid = Request.QueryString[Constant.UrlParamName.CustomerUID];
            if (!string.IsNullOrEmpty(uid))
            {
                url_param = string.Format("?{0}={1}", Constant.UrlParamName.CustomerUID, uid);
            }
            else
            {
                tblCustomer ent = new tblCustomer();
                ent =basepage.GetCustomerFromSession();
                if (ent != null)
                {
                    url_param = ent.CustomerUID.ToString();
                }
                else
                {
                    url_param = "false";
                }
            }
        }
        
    }
}